<?php

use Biz\service\wiki\Wiki;

/**
 * 跟进wiki id 查询wiki列表
 * Class GetListByIdsAction
 */
class GetListByIdsAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $wikiIds = $this->getRequest()->getPost('wiki_ids', '');
        $wikiIds = $wikiIds ? explode(',', $wikiIds) : [];
        if (count($wikiIds) >= 300) {
            throw new \Exception('已超数量上限');
        }
        $list = $wikiIds ? Wiki::getWikiList($wikiIds) : [];
        $this->setSuccess(['list' => array_values($list)]);
    }

}